package com.haoshuang.zhouzhoubang.utils

import android.app.Activity
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.os.Message
import com.alipay.sdk.app.PayTask
import com.haoshuang.zhouzhoubang.config.Config
import com.tencent.mm.opensdk.modelpay.PayReq
import com.tencent.mm.opensdk.openapi.WXAPIFactory

/**
 * 描述：PayUtil
 * 创建者: shichengxiang
 * 创建时间：2022/1/12
 */
object PayUtil {

    /**
     * 微信支付
     */
    fun wxPay(context: Context,appId:String?,partnerId:String?,prepayId:String?,packageValue:String?,nonceStr:String?,timeStamp:String?,extData:String?,sign:String?){
        var api=WXAPIFactory.createWXAPI(context, Config.WX_ID,false)
        api.registerApp(Config.WX_ID)
        var req=PayReq().apply {
            this.appId=appId
            this.partnerId=partnerId
            this.prepayId=prepayId
            this.packageValue=packageValue
            this.nonceStr=nonceStr
            this.timeStamp=timeStamp
            this.extData=extData
            this.sign=sign
        }
        api.sendReq(req)
    }

}